package com.haipumi.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.haipumi.beans.haipumi_customerService;
import com.haipumi.biz.CustomerServiceBiz;
import com.haipumi.mapper.CustomerServiceMapper;

@Service("customerServiceBiz")
public class CustomerServiceBizImpl implements CustomerServiceBiz {

	@Autowired
	private CustomerServiceMapper customerServiceMapper;
	
	@Override
	public haipumi_customerService login(haipumi_customerService customerService) {
		customerService=customerServiceMapper.login(customerService);
		if(customerService!=null){
			customerService.setCstatus("1");
			customerServiceMapper.updataStatus(customerService);
		}
		return customerService;
	}

	@Override
	public boolean logout(haipumi_customerService customerService) {
		int flag=customerServiceMapper.updataStatus(customerService);
		if(flag>0){
			return true;
		}
		return false;
	}

	@Override
	public List<haipumi_customerService> findAll() {
		return customerServiceMapper.findAll();
	}

	@Override
	public haipumi_customerService update(
			haipumi_customerService customerService) {
		return customerServiceMapper.update(customerService);
	}

}
